﻿import { createBrowserRouter } from 'react-router-dom'
import AppShell from '../layouts/AppShell'
import LandingPage from '../pages/LandingPage'
import AuthPage from '../pages/AuthPage'
import DashboardPage from '../pages/DashboardPage'
import DiaryPage from '../pages/DiaryPage'
import DiaryDetailPage from '../pages/DiaryDetailPage'
import AnniversariesPage from '../pages/AnniversariesPage'
import CyclePage from '../pages/CyclePage'
import ProfilePage from '../pages/ProfilePage'
import AssistantPage from '../pages/AssistantPage'
import RelationshipsPage from '../pages/RelationshipsPage'
import NotFoundPage from '../pages/NotFoundPage'
import RequireAuth from '../components/RequireAuth'
import ForgotPasswordPage from '../pages/ForgotPasswordPage'
import ResetPasswordPage from '../pages/ResetPasswordPage'
import MemoryGraphPage from '../pages/MemoryGraphPage'
import RandomizerPage from '../pages/RandomizerPage'

export const router = createBrowserRouter([
  {
    path: '/',
    element: (
      <RequireAuth>
        <AppShell />
      </RequireAuth>
    ),
    children: [
      { index: true, element: <DashboardPage /> },
      { path: '/dashboard', element: <DashboardPage /> },
      { path: '/diary', element: <DiaryPage /> },
      { path: '/diary/:entryId', element: <DiaryDetailPage /> },
      { path: '/anniversaries', element: <AnniversariesPage /> },
      { path: '/cycle', element: <CyclePage /> },
      { path: '/assistant', element: <AssistantPage /> },
      { path: '/assistant/graph', element: <MemoryGraphPage /> },
      { path: '/randomizer', element: <RandomizerPage /> },
      { path: '/relationships', element: <RelationshipsPage /> },
      { path: '/profile', element: <ProfilePage /> },
    ],
  },
  { path: '/landing', element: <LandingPage /> },
  { path: '/auth', element: <AuthPage /> },
  {
    path: '/forgot-password',
    element: <ForgotPasswordPage />,
  },
  {
    path: '/reset-password',
    element: <ResetPasswordPage />,
  },
  {
    path: '*',
    element: <NotFoundPage />,
  },
])

export default router


